package cc.magicjson.mall.order.domain.model;


import cc.magicjson.mall.common.domain.ProductId;
import cc.magicjson.mall.common.domain.ValueObject;

/**
 * OrderLine 值对象
 */
public class OrderLine implements ValueObject {
    private final ProductId productId;
    private final int quantity;
    private final Money price;

    public OrderLine(ProductId productId, int quantity, Money price) {
        this.productId = productId;
        this.quantity = quantity;
        this.price = price;
    }

    public Money calculatePrice() {
        return price.multiply(quantity);
    }

    // Getters
}